<!DOCTYPE html>
<html id="iframe">
	<head>
		<meta charset="UTF-8">
		
		<title>{:C('sitename')}</title>
		<meta name="keywords" content="{:C('keyword')}">
		<meta name="description" content="{:C('content')}">
		
		<meta name="renderer" content="webkit">
		<meta name="format-detection" content="telephone=no,email=no"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
		<meta name="telephone=no"  content="format-detection">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no" />
		
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
		<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
		<META HTTP-EQUIV="Expires" CONTENT="0">
		
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/lib.css"/>
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/public.css"/>
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/page.css"/>
	</head>
	<style>
		/*分页样式*/
		.pages a,.pages span {
		    display:inline-block;
		    padding:4px 7px;
		    margin:0 2px;
		    border:1px solid #D5D4D4;
		    -webkit-border-radius:1px;
		    -moz-border-radius:1px;
		    border-radius:1px;
		}
		.pages a,.pages li {
		    display:inline-block;
		    list-style: none;
		    text-decoration:none; color:#15AF11;
		}
		
		.pages a:hover{
		    border-color:#15AF11;
		}
		.pages span.current{
		    background:#15AF11;
		    color:#FFF;
		    font-weight:700;
		    border-color:#15AF11;
		}
		.pages{
			margin-top: 8px;
			text-align: center;
		}
		/*分页样式*/
	</style>
	<body>
		<div class="record">
			<div class="record-top">
				<p class="intro">
					<span>会员:<i>{$userinfo.nickname}</i></span>
					<span>点数:<i>{$userinfo.points}</i></span>
					<span>代理:<i>DS1688</i></span>
					<span>编号:<i>PKW{$userinfo.id}</i></span>
				</p>
				<p class="lable">
					<a href="{:U('Home/Circle/record')}?t=1"><span>{$today|date="m-d",###}</span></a>
					<a href="{:U('Home/Circle/record')}?t=2"><span>{$today-86400|date="m-d",###}</span></a>
					<a href="{:U('Home/Circle/record')}?t=3"><span>{$today-86400*2|date="m-d",###}</span></a>
					<a href="{:U('Home/Circle/record')}?t=4"><span>账务</span></a>
				</p>
			</div>
			<div class="record-content">
				<empty name="list">
					<p class="record-no"><span>
						<if condition="$t eq 1">{$today|date="m-d",###}</if>
						<if condition="$t eq 2">{$today-86400|date="m-d",###}</if>
						<if condition="$t eq 3">{$today-86400*2|date="m-d",###}</if>
						 无资料
					</span></p>
					<else/>
					<if condition="$t eq 4">
						<table>
							<thead>
								<tr>
									<th>#</th>
									<th>时间</th>
									<!--<th>单号</th>-->
									<th>内容</th>
									<th>进项</th>
									<th>出项</th>
									<th>余额</th>
								</tr>	
							</thead>
							<tbody>
								<tr>
									<td colspan="7">{$today|date="Y-m-d",###}</td>
								</tr>
								<volist name="list" id="vo">
									<tr>
										<td>{$i}.</td>
										<td>{$vo.time|date="H:i:s",###}</td>
										<!--<td>{$vo.time|mb_substr=3,8,utf8}</td>-->
										<td>期号:{$vo.number},{$vo.jincai}</td>
										<td>{$vo.add_points}</td>
										<td>{$vo.del_points}</td>
										<td>{$vo.balance}</td>
									</tr>
								</volist>
							</tbody>
						</table>
						<else/>
						<table>
							<volist name="list1" id="vo" key="i">
								<thead>
									<tr>
										<th colspan="6">
											<?php
												$periodnumber = $vo['number'];
												$awardnumbers = M('number')->where("periodnumber = $periodnumber")->find();
												$data = explode(',',$awardnumbers['awardnumbers']);
												for($i=0;$i<count($data);$i++){
													if($data[$i]<10){
														$data[$i] = substr($data[$i],1);
													}
												}
												
												?>
											<span>期号：{$vo.number}<if condition="$number eq $vo['number']">
												(未开奖)
												<else/>
												(
												<volist name="data" id="y" key="i">
													<if condition="$i eq 10">
														{$y}
														<else/>
														{$y},
													</if>
												</volist>
												)	
											</if></span>
											<if condition="$number eq $vo['number']">
												<a class="bt bt-red" onclick="del_all('{$vo.number}')">全部取消</a>
											</if>
										</th>
									</tr>
								</thead>
								<thead>
									<tr>
										<th>#</th>
										<th>竞猜时间</th>
										<th>竞猜单号</th>
										<th>内容1</th>
										<th>点数</th>
										<th>结果</th>
									</tr>	
								</thead>
								<tbody>
									<volist name="vo.order" id="r">
										<tr>
											<td>1.</td>
											<td>{$r.time|date="Y-m-d H:i:s",###}</td>
											<td>{$r.id}</td>
											<td>{$r.jincai}</td>
											<td>{$r.del_points}</td>
											<td>
												<if condition="$number eq $vo['number']">
													<a class="bt bt-red" onclick="del('{$r.id}')">取消</a>
													<else/>
													{$r['add_points']-$r['del_points']}
												</if>
											</td>
										</tr>
									</volist>
								</tbody>
							</volist>
						</table>
					</if>
				</empty>
			</div>
			<div class="pages">
				{$show}
			</div>
		</div>
		
		
		<script src='//cdn.bootcss.com/jquery/1.11.3/jquery.js'></script>
		<script src="__PUBLIC__/layer/layer.js"></script>
		<script>
			function del(id){
				layer.open({
				    content: '您确定要取消吗？'
				    ,btn: ['确认', '取消']
				    ,yes: function(index){
				      	layer.close(index);
				      	$.ajax({
	                       	url: "{:U('Home/Circle/del')}",
	                       	type: "post",
	                       	data:{'id':id},
	                       	dataType:'json',
	                       	error:function(){
	                       		parent.layer.open({content: '服务器开小差了~',skin: 'msg',time: 2});
		                    },
	                       	success:function(res){
	                       		location.href=location.href;
	                       	}
	                   	});
				    }
				});
			}
			function del_all(number){
				layer.open({
				    content: '您确定要取消吗？'
				    ,btn: ['确认', '取消']
				    ,yes: function(index){
				      	layer.close(index);
				      	$.ajax({
	                       	url: "{:U('Home/Circle/del_all')}",
	                       	type: "post",
	                       	data:{'number':number},
	                       	dataType:'json',
	                       	error:function(){
	                       		parent.layer.open({content: '服务器开小差了~',skin: 'msg',time: 2});
		                    },
	                       	success:function(res){
	                       		location.href=location.href;
	                       	}
	                   	});
				    }
				});
			}
		</script>
	</body>
</html>
